import request from '@/utils/request'

// 查询基金估值列表
export function listFundValuation(query) {
  return request({
    url: '/valuation/fundValuation/list',
    method: 'get',
    params: query
  })
}

// 查询基金估值详细
export function getFundValuation(id) {
  return request({
    url: '/valuation/fundValuation/' + id,
    method: 'get'
  })
}

// 保存基金估值
export function saveFundValuation(data) {
  return request({
    url: '/valuation/fundValuation/save',
    method: 'post',
    data: data
  })
}

// 删除基金估值
export function delFundValuation(id) {
  return request({
    url: '/valuation/fundValuation/' + id,
    method: 'delete'
  })
}

export function delOtherFundValuation(id) {
  return request({
    url: '/valuation/fundValuation/other/' + id,
    method: 'delete'
  })
}

// 导出基金估值
export function exportFundValuation(query) {
  return request({
    url: '/valuation/fundValuation/export',
    method: 'get',
    params: query
  })
}

// 点击新增按钮时 获取基金估值部分基本信息
export function getFundValuationBaseInfo(fundId) {
  return request({
    url: '/valuation/fundValuation/getFundValuationBaseInfo/' + fundId,
    method: 'get'
  })
}

// 查询基金估值信息返回给Chart组件使用
export function valuationCharts(params) {
  return request({
    url: '/valuation/fundValuation/valuationCharts',
    method: 'get',
    params: params
  })
}

export function getFundValuationMain(fundId, date) {
  return request({
    url: '/valuation/fundValuation/getFundValuationMain/' + fundId + '/' + date,
    method: 'get'
  })
}
